Repository navigation
feat(cli): 启动计划给出 newWindow 与 handOff,再次启动交给已在运行的副本 - #235
Merged
Merged
Conversation
planLaunch 新增 --new-window 标记(顺序固定为 --cli、--new-window、--), 返回 newWindow 和 handOff。没有标记的 welcome/open 启动 handOff 为 true, 宿主把它交给同一份用户数据上已在运行的副本;宿主自己为新窗口拉起的进程、 CLI 启动器进程、help 和 version 都不交接。 共享 fixture 补齐交接、新窗口和 version 的用例,并新增 Core 侧 fixture 测试, 与桌面端按同一份数据校验。
xiaoyumuxi
added a commit
to 1lck/Lithe-IDEA
that referenced
this pull request
Nov 30, 2026
Lithe 已在运行时,lithe <路径>、访达或 Dock 再次启动不再新开进程:新进程按 Core planLaunch 的 handOff 用 Viva singleinstance 把解析后的绝对路径交给运行副本,然后在建窗口、日志和插件之前退出。运行副本把窗口带到前台,经 Core 二次校验、重新观察路径后,文件夹按“打开项目的位置”打开(已打开的切过去),文件开单文件标签。找不到运行副本才自己启动。 - 实例名包含用户数据目录;开发构建再加可执行文件路径和修改时间,不交给安装版或旧构建 - --new-window 另开进程;单文件窗口“以项目打开所在文件夹”改用它 - LaunchInbox 在窗口就绪前最多排队 16 个启动,随事件循环结束释放认领 - 访达交来的文件夹按项目打开(原来被拒绝),提示落在当前显示的标签上 - 修复单文件标签与项目标签的标签栏 key 冲突、showing() 误匹配单文件标签 - 固定 Core 744d2f5(Lithe-IDEA/Lithe-core-rust#235),合入后换 main 提交 - 新增 Agent Note 与功能矩阵条目 cli-launch-handoff Closes #2545
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs 1lck/Lithe-IDEA#2545(桌面端实现:1lck/Lithe-IDEA#2548)
桌面端要让再次启动(
lithe <路径>、访达、Dock)把路径交给已在运行的 Lithe,而不是每次新开一个进程。是否交接属于启动参数规则,所以放在 Core 的application.cli.planLaunch里决定,桌面端不自己解析参数。改动:
application.cli.planLaunch新增两个返回字段:newWindow:参数里带--new-window,表示宿主自己启动的、要另开窗口的进程(例如单文件窗口里的“以项目打开所在文件夹”)。handOff:动作是welcome或open,并且既没有--cli也没有--new-window时为真。宿主据此把启动交给同一份用户数据上已在运行的副本;help、version和启动器自己的--cli进程都不交接。--cli、--new-window、--;--之后的--new-window被当成路径,顺序颠倒的标记报invalid_request。take_marker统一剥离标记,原有--cli、--行为不变。rust/fixtures/application/cli-v1.json增加newWindow、handOff用例,cli_fixture.rs校验新字段;单测覆盖交接、新窗口、启动器、帮助/版本和位置敏感的标记。rust/contracts/rust-core-api.md写明新字段与交接语义。app.action.performed的surface增加取值launch,表示运行副本接手的一次再次启动;catalog_generated.rs由log-events重新生成。这不是插件协议改动,不涉及能力版本和插件协议更新记录。
验证
cargo test -p lithe-core-rules(含cli_fixture)cargo test -p lithe-diagnosticslog-events --checkcargo fmt --check、cargo clippydesktop-go.sh test ./...和internal/core、internal/cli、internal/workbench测试合入后桌面端把
PINNED_CORE_REVISION换成 main 上的提交。